package com.mine.site.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import com.mine.site.model.Commodity;
import com.mine.site.util.DbUtil;

public class YifuDao {
	
	

		public List<Commodity> findAll_clvz() {
			List<Commodity> Commo_clnz = new ArrayList<Commodity>();
			String sql = "select * from clnz where type ='clnz' ";
			Statement stmt = null;
			try {
				stmt = DbUtil.getInstance().getConn().createStatement();
				ResultSet rs = stmt.executeQuery(sql);
				while (rs.next()) {
					Commodity u = new Commodity();
					u.setType(rs.getString(9));
					u.setNumber(rs.getInt(1));
					u.setName(rs.getString(2));
					u.setTitle(rs.getString(3));
					u.setPrice(rs.getString(4));
					u.setUrl(rs.getString(5));
					u.setImg_1(rs.getString(6));
					u.setImg_2(rs.getString(7));
					u.setMinute(rs.getString(8));
			
					Commo_clnz.add(u);
				}
				rs.close();
				stmt.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			return Commo_clnz;
		}
	
		public List<Commodity> findAll_lyq() {
			List<Commodity> Commo_lyq = new ArrayList<Commodity>();
			String sql = "select * from clnz where type ='lyq'";
			Statement stmt = null;
			try {
				stmt = DbUtil.getInstance().getConn().createStatement();
				ResultSet rs = stmt.executeQuery(sql);
				while (rs.next()) {
					Commodity u = new Commodity();
					u.setType(rs.getString(9));
					u.setNumber(rs.getInt(1));
					u.setName(rs.getString(2));
					u.setTitle(rs.getString(3));
					u.setPrice(rs.getString(4));
					u.setUrl(rs.getString(5));
					u.setImg_1(rs.getString(6));
					u.setImg_2(rs.getString(7));
					u.setMinute(rs.getString(8));
			
					Commo_lyq.add(u);
				}
				rs.close();
				stmt.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			return Commo_lyq;
		}
		
		public List<Commodity> findAll_clnanz() {
			List<Commodity> Commo_clnanz = new ArrayList<Commodity>();
			String sql = "select * from clnz where type ='clnanz' ";
			Statement stmt = null;
			try {
				stmt = DbUtil.getInstance().getConn().createStatement();
				ResultSet rs = stmt.executeQuery(sql);
				while (rs.next()) {
					Commodity u = new Commodity();
					u.setType(rs.getString(9));
					u.setNumber(rs.getInt(1));
					u.setName(rs.getString(2));
					u.setTitle(rs.getString(3));
					u.setPrice(rs.getString(4));
					u.setUrl(rs.getString(5));
					u.setImg_1(rs.getString(6));
					u.setImg_2(rs.getString(7));
					u.setMinute(rs.getString(8));
			
					Commo_clnanz.add(u);
				}
				rs.close();
				stmt.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			return Commo_clnanz;
		}
		
		public List<Commodity> findAll_nantx() {
			List<Commodity> Commo_nantx = new ArrayList<Commodity>();
			String sql = "select * from clnz where type ='nstx'";
			Statement stmt = null;
			try {
				stmt = DbUtil.getInstance().getConn().createStatement();
				ResultSet rs = stmt.executeQuery(sql);
				while (rs.next()) {
					Commodity u = new Commodity();
					u.setType(rs.getString(9));
					u.setNumber(rs.getInt(1));
					u.setName(rs.getString(2));
					u.setTitle(rs.getString(3));
					u.setPrice(rs.getString(4));
					u.setUrl(rs.getString(5));
					u.setImg_1(rs.getString(6));
					u.setImg_2(rs.getString(7));
					u.setMinute(rs.getString(8));
			
					Commo_nantx.add(u);
				}
				rs.close();
				stmt.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			return Commo_nantx;
		}
		
		public List<Commodity> findAll_nvtx() {
			List<Commodity> Commo_nvtx = new ArrayList<Commodity>();
			String sql = "select * from clnz where type ='nvtx' ";
			Statement stmt = null;
			try {
				stmt = DbUtil.getInstance().getConn().createStatement();
				ResultSet rs = stmt.executeQuery(sql);
				while (rs.next()) {
					Commodity u = new Commodity();
					u.setType(rs.getString(9));
					u.setNumber(rs.getInt(1));
					u.setName(rs.getString(2));
					u.setTitle(rs.getString(3));
					u.setPrice(rs.getString(4));
					u.setUrl(rs.getString(5));
					u.setImg_1(rs.getString(6));
					u.setImg_2(rs.getString(7));
					u.setMinute(rs.getString(8));
			
					Commo_nvtx.add(u);
				}
				rs.close();
				stmt.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			return Commo_nvtx;
		}
		
		
		public List<Commodity> findAll_jpnk() {
			List<Commodity> Commo_jpnk = new ArrayList<Commodity>();
			String sql = "select * from clnz where type ='jpnk'";
			Statement stmt = null;
			try {
				stmt = DbUtil.getInstance().getConn().createStatement();
				ResultSet rs = stmt.executeQuery(sql);
				while (rs.next()) {
					Commodity u = new Commodity();
					u.setType(rs.getString(9));
					u.setNumber(rs.getInt(1));
					u.setName(rs.getString(2));
					u.setTitle(rs.getString(3));
					u.setPrice(rs.getString(4));
					u.setUrl(rs.getString(5));
					u.setImg_1(rs.getString(6));
					u.setImg_2(rs.getString(7));
					u.setMinute(rs.getString(8));
			
					Commo_jpnk.add(u);
				}
				rs.close();
				stmt.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			return Commo_jpnk;
		}

		
		public List<Commodity> findAll_jonk() {
			List<Commodity> Commo_jonk = new ArrayList<Commodity>();
			String sql = "select * from clnz where type ='jonk' ";
			Statement stmt = null;
			try {
				stmt = DbUtil.getInstance().getConn().createStatement();
				ResultSet rs = stmt.executeQuery(sql);
				while (rs.next()) {
					Commodity u = new Commodity();
					u.setType(rs.getString(9));
					u.setNumber(rs.getInt(1));
					u.setName(rs.getString(2));
					u.setTitle(rs.getString(3));
					u.setPrice(rs.getString(4));
					u.setUrl(rs.getString(5));
					u.setImg_1(rs.getString(6));
					u.setImg_2(rs.getString(7));
					u.setMinute(rs.getString(8));
			
					Commo_jonk.add(u);
				}
				rs.close();
				stmt.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			return Commo_jonk;
		}
		
		public List<Commodity> findAll_cjwt() {
			List<Commodity> Commo_cjwt = new ArrayList<Commodity>();
			String sql = "select * from clnz where type ='cjwt'";
			Statement stmt = null;
			try {
				stmt = DbUtil.getInstance().getConn().createStatement();
				ResultSet rs = stmt.executeQuery(sql);
				while (rs.next()) {
					Commodity u = new Commodity();
					u.setType(rs.getString(9));
					u.setNumber(rs.getInt(1));
					u.setName(rs.getString(2));
					u.setTitle(rs.getString(3));
					u.setPrice(rs.getString(4));
					u.setUrl(rs.getString(5));
					u.setImg_1(rs.getString(6));
					u.setImg_2(rs.getString(7));
					u.setMinute(rs.getString(8));
			
					Commo_cjwt.add(u);
				}
				rs.close();
				stmt.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			return Commo_cjwt;
		}
		
		public List<Commodity> findAll_xlbx() {
			List<Commodity> Commo_xlbx = new ArrayList<Commodity>();
			String sql = "select * from clnz where type ='xlbx'";
			Statement stmt = null;
			try {
				stmt = DbUtil.getInstance().getConn().createStatement();
				ResultSet rs = stmt.executeQuery(sql);
				while (rs.next()) {
					Commodity u = new Commodity();
					u.setType(rs.getString(9));
					u.setNumber(rs.getInt(1));
					u.setName(rs.getString(2));
					u.setTitle(rs.getString(3));
					u.setPrice(rs.getString(4));
					u.setUrl(rs.getString(5));
					u.setImg_1(rs.getString(6));
					u.setImg_2(rs.getString(7));
					u.setMinute(rs.getString(8));
			
					Commo_xlbx.add(u);
				}
				rs.close();
				stmt.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			return Commo_xlbx;
		}
		
		
}
